PREFIX := /usr/local
current_rev := $(shell cat mythvideo-scanner.pl |grep '$Rev:'|awk '{ print $$5 }';)

install:
	mkdir -p $(PREFIX)/share/mythvideo-scanner/modules/
	mkdir -p $(PREFIX)/share/mythvideo-scanner/grabbers/
	cp --preserve=mode modules/MythTV.pm $(PREFIX)/share/mythvideo-scanner/modules/
	cp --preserve=mode grabbers/* $(PREFIX)/share/mythvideo-scanner/grabbers/
	cp --preserve=mode mythvideo-scanner.pl $(PREFIX)/bin/
	cp --preserve=mode mythvideo-cleaner.pl $(PREFIX)/bin/
	cp --preserve=mode mythvideo-prune.pl $(PREFIX)/bin/

uninstall:
	rm -rf $(PREFIX)/share/mythvideo-scanner
	rm -f $(PREFIX)/bin/mythvideo-scanner.pl
	rm -f $(PREFIX)/bin/mythvideo-cleaner.pl
	rm -f $(PREFIX)/bin/mythvideo-prune.pl

upgrade:
	@svn export http://mythvideo-scanner.googlecode.com/svn/trunk/ . --force
	@svn log http://mythvideo-scanner.googlecode.com/svn/trunk/ -r $(current_rev):HEAD
